package com.castle.fortress.admin.cms.config;

import com.castle.fortress.admin.cms.dto.CmsColConfigDto;
import com.castle.fortress.common.enums.ValidateTypeEnum;
import com.castle.fortress.common.enums.ViewFormTypeEnum;
import com.castle.fortress.common.enums.YesNoEnum;
import org.springframework.context.annotation.Configuration;

import java.util.ArrayList;
import java.util.List;

/**
 * 系统预设的模型字段，所有创建模型都会具备下列字段
 * 注：该字段必须被包含在cms_article表中
 */
@Configuration
public class ModelColumn {
	public static List<CmsColConfigDto> sysCols=new ArrayList<>();
	static{
		CmsColConfigDto title=new CmsColConfigDto(-11L,"标题","title","title","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.TEXT.getCode(),"",null,true);
		CmsColConfigDto author=new CmsColConfigDto(-12L,"作者","author","author","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.TEXT.getCode(),"",null,true);
		CmsColConfigDto info=new CmsColConfigDto(-13L,"描述","info","info","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.MULTI_TEXT.getCode(),"",null,true);
		CmsColConfigDto keywords=new CmsColConfigDto(-14L,"关键字","keywords","keywords","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.TEXT.getCode(),"",null,true);
		CmsColConfigDto source=new CmsColConfigDto(-15L,"来源","source","source","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.TEXT.getCode(),"",null,true);
		CmsColConfigDto contents=new CmsColConfigDto(-16L,"内容","contents","contents","text","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.RICH_TEXT.getCode(),"",null,true);
		CmsColConfigDto picname=new CmsColConfigDto(-17L,"缩略图","picname","picname","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.IMAGE_UPLOAD.getCode(),"",1,true);
		CmsColConfigDto publisher=new CmsColConfigDto(-18L,"发布人","publisher","publisher","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.TEXT.getCode(),"",null,true);
		CmsColConfigDto pubdate=new CmsColConfigDto(-19L,"发布时间","pubdate","pubdate","datetime(0)","Date", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.DATE_TIME.getCode(),"",null,true);
		CmsColConfigDto url=new CmsColConfigDto(-20L,"访问地址","url","url","varchar(255)","String", YesNoEnum.NO.getCode(), ValidateTypeEnum.VALIDATE_URL.getCode(), ViewFormTypeEnum.TEXT.getCode(),"",null,true);
		CmsColConfigDto click=new CmsColConfigDto(-21L,"浏览次数","click","click","int(9)","Integer", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.NUMBER.getCode(),"",null,true);
		CmsColConfigDto sort=new CmsColConfigDto(-22L,"权重排序","sort","sort","int(9)","Integer", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.NUMBER.getCode(),"",null,true);
		CmsColConfigDto status=new CmsColConfigDto(-23L,"状态","status","status","int(2)","Integer", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.SELECT.getCode(),"",null,true);
		CmsColConfigDto auditer=new CmsColConfigDto(-24L,"审核人","auditer","auditer","bigint(64)","Long", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.TEXT.getCode(),"",null,true);
		CmsColConfigDto auditdate=new CmsColConfigDto(-25L,"审核时间","auditdate","auditdate","datetime(0)","Date", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.DATE_TIME.getCode(),"",null,true);
		CmsColConfigDto auditop=new CmsColConfigDto(-26L,"审核意见","auditop","auditop","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.MULTI_TEXT.getCode(),"",null,true);
		CmsColConfigDto attr=new CmsColConfigDto(-27L,"属性","attr","attr","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.CHECK_BOX.getCode(),"",null,true);
		CmsColConfigDto tag=new CmsColConfigDto(-27L,"标签","tag","tag","varchar(255)","String", YesNoEnum.NO.getCode(), null, ViewFormTypeEnum.CHECK_BOX.getCode(),"",null,true);
		sysCols.add(title);
		sysCols.add(author);
		sysCols.add(info);
		sysCols.add(keywords);
		sysCols.add(source);
		sysCols.add(contents);
		sysCols.add(picname);
		sysCols.add(publisher);
		sysCols.add(pubdate);
		sysCols.add(url);
		sysCols.add(click);
		sysCols.add(sort);
		sysCols.add(status);
		sysCols.add(auditer);
		sysCols.add(auditdate);
		sysCols.add(auditop);
		sysCols.add(attr);
		sysCols.add(tag);
	}

	}

